import { dirname, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import { toPosixPath } from './toPosixPath.ts'

const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)

// Resolve to absolute path first, then convert to posix
const scriptDir = resolve(__dirname)
export const PROJECT_ROOT = toPosixPath(resolve(scriptDir, '../..'))
